<script>

const p1 = Promise.resolve(1)
const p2 = Promise.reject(2)

Promise.all([p1,p2].map(p => p.then(res=>({status:'ok',res})).catch(err=>({status:'err', err})))).then(res=>{
  console.log(res)
}).catch(err=>{
  console.log(err)
})

// Promise.allSettled([p1,p2]).then(res=>{
//   console.log(res)
// }).catch(err=>{
//   console.log(err)
// })

</script>